package com.mkait.thief.controller;

import com.mkait.thief.service.ComplaintService;
import com.mkait.thief.util.ResponseWrapper;
import com.mkait.thief.util.WrapResponseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/complaint")
@RestController
@Transactional(rollbackFor = Exception.class)
public class ComplaintController {

    @Autowired
    private ComplaintService complaintService;

    @GetMapping("/refuseComplaint")
    public ResponseEntity<ResponseWrapper<String>> refuseComplaint(@RequestParam("complaintId") String complaintId) {
        complaintService.refuseComplaint(complaintId);
        return WrapResponseMapper.ok(ResponseWrapper.SUCCESS_MESSAGE);
    }



}
